package com.itzhoun.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author 周楠
 * @Date 2023/01/16/下午 1:35
 */
public class DynamicProxyHandler implements InvocationHandler {


    private Object object;

    public DynamicProxyHandler(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("买房前准备");
        Object invoke = method.invoke(object, args);
        System.out.println("买房后准备");
        return invoke;

    }
}
